\(\int \frac {\sec ^4(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx\) [172]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 31, antiderivative size = 34 \[ \int \frac {\sec ^4(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx=-\frac {i (i-\cot (c+d x))^3 \tan ^3(c+d x)}{3 a^2 d} \]

[Out]

-1/3*I*(I-cot(d*x+c))^3*tan(d*x+c)^3/a^2/d

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.097, Rules used = {3167, 862, 37} \[ \int \frac {\sec ^4(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx=-\frac {i \tan ^3(c+d x) (-\cot (c+d x)+i)^3}{3 a^2 d} \]

[In]

Int[Sec[c + d*x]^4/(a*Cos[c + d*x] + I*a*Sin[c + d*x])^2,x]

[Out]

((-1/3*I)*(I - Cot[c + d*x])^3*Tan[c + d*x]^3)/(a^2*d)

Rule 37

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(a + b*x)^(m + 1)*((c + d*x)^(n +
1)/((b*c - a*d)*(m + 1))), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[b*c - a*d, 0] && EqQ[m + n + 2, 0] && NeQ
[m, -1]

Rule 862

Int[((d_) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[(d + e*x)
^(m + p)*(f + g*x)^n*(a/d + (c/e)*x)^p, x] /; FreeQ[{a, c, d, e, f, g, m, n}, x] && NeQ[e*f - d*g, 0] && EqQ[c
*d^2 + a*e^2, 0] && (IntegerQ[p] || (GtQ[a, 0] && GtQ[d, 0] && EqQ[m + p, 0]))

Rule 3167

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symb
ol] :> Dist[-d^(-1), Subst[Int[x^m*((b + a*x)^n/(1 + x^2)^((m + n + 2)/2)), x], x, Cot[c + d*x]], x] /; FreeQ[
{a, b, c, d}, x] && IntegerQ[n] && IntegerQ[(m + n)/2] && NeQ[n, -1] &&  !(GtQ[n, 0] && GtQ[m, 1])

Rubi steps \begin{align*} \text {integral}& = -\frac {\text {Subst}\left (\int \frac {\left (1+x^2\right )^2}{x^4 (i a+a x)^2} \, dx,x,\cot (c+d x)\right )}{d} \\ & = -\frac {\text {Subst}\left (\int \frac {\left (-\frac {i}{a}+\frac {x}{a}\right )^2}{x^4} \, dx,x,\cot (c+d x)\right )}{d} \\ & = -\frac {i (i-\cot (c+d x))^3 \tan ^3(c+d x)}{3 a^2 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.10 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.06 \[ \int \frac {\sec ^4(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx=-\frac {\tan (c+d x) \left (-3+3 i \tan (c+d x)+\tan ^2(c+d x)\right )}{3 a^2 d} \]

[In]

Integrate[Sec[c + d*x]^4/(a*Cos[c + d*x] + I*a*Sin[c + d*x])^2,x]

[Out]

-1/3*(Tan[c + d*x]*(-3 + (3*I)*Tan[c + d*x] + Tan[c + d*x]^2))/(a^2*d)

Maple [A] (verified)

Time = 0.65 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.59

method result size
derivativedivides \(-\frac {\left (\tan \left (d x +c \right )+i\right )^{3}}{3 d \,a^{2}}\) \(20\)
default \(-\frac {\left (\tan \left (d x +c \right )+i\right )^{3}}{3 d \,a^{2}}\) \(20\)
risch \(\frac {8 i}{3 a^{2} d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3}}\) \(23\)
norman \(\frac {\frac {4 i \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{a d}-\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}+\frac {20 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3 a d}-\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{a d}-\frac {4 i \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{a d}}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3} a \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}\) \(127\)

[In]

int(sec(d*x+c)^4/(cos(d*x+c)*a+I*a*sin(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

-1/3/d/a^2*(tan(d*x+c)+I)^3

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 54 vs. \(2 (26) = 52\).

Time = 0.25 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.59 \[ \int \frac {\sec ^4(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx=\frac {8 i}{3 \, {\left (a^{2} d e^{\left (6 i \, d x + 6 i \, c\right )} + 3 \, a^{2} d e^{\left (4 i \, d x + 4 i \, c\right )} + 3 \, a^{2} d e^{\left (2 i \, d x + 2 i \, c\right )} + a^{2} d\right )}} \]

[In]

integrate(sec(d*x+c)^4/(a*cos(d*x+c)+I*a*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

8/3*I/(a^2*d*e^(6*I*d*x + 6*I*c) + 3*a^2*d*e^(4*I*d*x + 4*I*c) + 3*a^2*d*e^(2*I*d*x + 2*I*c) + a^2*d)

Sympy [F]

\[ \int \frac {\sec ^4(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx=\frac {\int \frac {\sec ^{4}{\left (c + d x \right )}}{- \sin ^{2}{\left (c + d x \right )} + 2 i \sin {\left (c + d x \right )} \cos {\left (c + d x \right )} + \cos ^{2}{\left (c + d x \right )}}\, dx}{a^{2}} \]

[In]

integrate(sec(d*x+c)**4/(a*cos(d*x+c)+I*a*sin(d*x+c))**2,x)

[Out]

Integral(sec(c + d*x)**4/(-sin(c + d*x)**2 + 2*I*sin(c + d*x)*cos(c + d*x) + cos(c + d*x)**2), x)/a**2

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.03 \[ \int \frac {\sec ^4(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx=-\frac {\tan \left (d x + c\right )^{3} + 3 i \, \tan \left (d x + c\right )^{2} - 3 \, \tan \left (d x + c\right )}{3 \, a^{2} d} \]

[In]

integrate(sec(d*x+c)^4/(a*cos(d*x+c)+I*a*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

-1/3*(tan(d*x + c)^3 + 3*I*tan(d*x + c)^2 - 3*tan(d*x + c))/(a^2*d)

Giac [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.03 \[ \int \frac {\sec ^4(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx=-\frac {\tan \left (d x + c\right )^{3} + 3 i \, \tan \left (d x + c\right )^{2} - 3 \, \tan \left (d x + c\right )}{3 \, a^{2} d} \]

[In]

integrate(sec(d*x+c)^4/(a*cos(d*x+c)+I*a*sin(d*x+c))^2,x, algorithm="giac")

[Out]

-1/3*(tan(d*x + c)^3 + 3*I*tan(d*x + c)^2 - 3*tan(d*x + c))/(a^2*d)

Mupad [B] (verification not implemented)

Time = 23.71 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.44 \[ \int \frac {\sec ^4(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx=-\frac {\sin \left (c+d\,x\right )\,\left (-4\,{\cos \left (c+d\,x\right )}^2+3{}\mathrm {i}\,\sin \left (c+d\,x\right )\,\cos \left (c+d\,x\right )+1\right )}{3\,a^2\,d\,{\cos \left (c+d\,x\right )}^3} \]

[In]

int(1/(cos(c + d*x)^4*(a*cos(c + d*x) + a*sin(c + d*x)*1i)^2),x)

[Out]

-(sin(c + d*x)*(cos(c + d*x)*sin(c + d*x)*3i - 4*cos(c + d*x)^2 + 1))/(3*a^2*d*cos(c + d*x)^3)